package y23.May;

import java.util.Scanner;

public class HanoiTower {
    public static void main(String[] args){
        int n = 3;
        hanoi(n,'A','B','C');
    }
    public static void hanoi(int n,char x,char y,char z){
        if (n == 1){
            move(n,x,z);
        }
        else{
            hanoi(n - 1,x,z,y);
            move(n,x,z);
            hanoi(n - 1,y,x,z);

        }
    }
    public static void move(int n,char x,char y){
        System.out.println("将编号"+n+"从"+x+"->"+y);
    }
}
